

#ifndef _JACOBI_H
    #define _JACOBI_H


double max_openmp(double *vdif, double *vx, int size);
double diff(double *diff, int size);

/*Solve using Jacobi-Richardson method*/
double *solve_mpi(int argc, char *argv[],double *a, double *b, double *x, int m_order, int row_test,int max_it, double eps);


/*Solve using Jacobi-Richardson method*/
double *solve(double *a, double *b, double *x, int m_order, int row_test, int max_it, double eps);

/*Calculate the max absolute value from vdif div vx */
double max(double *vdif, double *vx, int size);

double diff(double *diff, int size);

/**
* Convergence test, check all rows
* return 1 if passed, 0 otherwise
*/
int row_eval(double *matrix, int order, double eps);

/**
* Convergence test, check  one rows
* return 1 if passed, 0 otherwise
*/
static int row_convergence(int row, double *matrix, int order, double eps);


/**
* Given the calculated X check  if row is correct
*/
static void check_result(int row, double *matrix, double *x, double b, int order);

#endif
